package com.link2room.blaster.service;

import com.link2room.blaster.dto.innerUse.InmailBaseDto;

import java.util.List;

/**
 * Created by LN on 2017/6/29.16:24
 */
public interface IInmailService {
    String generateInmailId() throws Exception;

    void createInmail(InmailBaseDto inmail, String inmailId, List<String> receiver) throws Exception;

    List<String> findReceiver(String inmailId) throws Exception;

    List<InmailBaseDto> findInmailBaseByInmailId(List<String> inmailIds) throws Exception;

    /**
     * 收件人已读修改状态
     * @param userCode
     * @param inmailId
     * @throws Exception
     */
    void readInmail(String userCode, String inmailId) throws Exception;

    /**
     * 是否全部收件人已读
     * @param inmailId
     * @return
     * @throws Exception
     */
    boolean hasReadAll(String inmailId) throws Exception;

    /**
     * 修改InmailBase 已读状态
     * @param inmailId
     * @throws Exception
     */
    void readBaseInamil(String inmailId) throws Exception;


    /**
     * 收件人已完成状态
     * @param userCode
     * @param inmailId
     * @throws Exception
     */
    void doInmail(String userCode, String inmailId) throws Exception;

    /**
     * 是否全部收件人已完成
     * @param inmailId
     * @return
     * @throws Exception
     */
    boolean hasDoneAll(String inmailId) throws Exception;

    /**
     * 修改InmailBase 已完成
     * @param inmailId
     * @throws Exception
     */
    void doBaseInamil(String inmailId) throws Exception;


    long countInmail(String userCode, String hasRead, String hasDone) throws Exception;

}
